<?php
/**
 * 
 * 后台通用文件
 */

@session_start();
define('IN_MBS', true);
define('G_OSGH_ROOT', str_replace("\\", '/', dirname(__FILE__))."/");
include_once G_OSGH_ROOT.'common.inc.php';

define('G_OSGH_NAME','旅行伴侣网');//用户模版显示


//初始化登录用户
global $_ADMIN_ID,$_ADMIN_NAME,$_ADMIN_TYPE,$_GROUP_ID,$_CINEMA_ID;
$_ADMIN_ID = 0;
$_ADMIN_NAME = '';
$_GROUP_ID = 0;
$_CINEMA_ID = '';
$_CINEMA_IDS = '';

if (isset($_SESSION['MBS_USER']))
{
	$_ADMIN_ID = intval($_SESSION['MBS_USER']['admin_id']);
	$_ADMIN_NAME = trim($_SESSION['MBS_USER']['admin_name']);
	
	$_GROUP_ID = intval($_SESSION['MBS_USER']['group_id']);
	$_CINEMA_ID = trim($_SESSION['MBS_USER']['cinemaid']);
	
	if (strpos($_SERVER['SCRIPT_FILENAME'], "login.php") !==false && $_REQUEST['op']!='logout')
	{
		echo '<script type="text/javascript">top.location.href = "/index.php";</script>';
		exit();
	}
	else if (strpos($_SERVER['SCRIPT_FILENAME'], "login.php") !==false && $_REQUEST['op']=='loginout')
	{
		echo '<script type="text/javascript">top.location.href = "/login.php";</script>';
		exit();
	}
}
/*
if (strpos($_SERVER['SCRIPT_FILENAME'], "login.php") === false )
{
	if( $_ADMIN_ID<1 || strlen($_ADMIN_NAME)<1 ){
		echo '<script type="text/javascript">top.location.href = "/login.php";</script>';
		exit();
	}
}*/
$g_osgh_module = basename($_SERVER['SCRIPT_NAME'],".php");

?>